package com.yili.oa.utils.hodle;

/**
 * @author lxr
 * @version v0.01
 * @date 2019/7/10 0010
 * @email 200890949@qq.com
 */
public class DataSourceContextHolder {
    // 默认数据源
    public static final String DEFAULT_DS = "db_manage";

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public static void setDB(String dbType) {
        contextHolder.set(dbType);
    }

    public static String getDB() {
        return (contextHolder.get());
    }

    public static void clearDB() {
        contextHolder.remove();
    }
}
